package com.bone.order.dao;

import java.util.List;
import java.util.Map;

import com.bone.common.BaseIbatisDAO;
import com.bone.order.po.OrdRefundment;
import com.bone.page.Page;


/**
 * DAO.
 * @author liwenzhan
 *
 */
public class OrdRefundmentDAO extends BaseIbatisDAO {

	
	/**
	 * 取符合查询条件的数据.
	 * @param parameter
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Page<OrdRefundment> queryOrdRefundmentPageByParam(Map<String, Object> para,Page page){
		Long totalResultSize = (Long) getSqlMapClientTemplate().queryForObject("ORD_REFUNDMENT.queryCountByParam", para);
		page.setTotalResultSize(totalResultSize);				
		para.put("startRows", page.getStartRows());				
		para.put("endRows", page.getEndRows());
		para.put("_order", "refundment_id");
		page.setItems(getSqlMapClientTemplate().queryForList("ORD_REFUNDMENT.queryPageByParam", para));
		return page;
	}
	
	/**
	 * 
	 * @param orderNo
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<OrdRefundment> queryRefundmentListByOrderNo(Long orderNo){
		return getSqlMapClientTemplate().queryForList("ORD_REFUNDMENT.queryOrdRefundmentListByOrderNo", orderNo);
	}
	
	/**
	 * 
	 * @param refundmentId
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public OrdRefundment queryOrdRefundmentById(Long refundmentId){
		return (OrdRefundment)getSqlMapClientTemplate().queryForObject("ORD_REFUNDMENT.queryOrdRefundmentById", refundmentId);
	}

}
